<?php
class CheckCategory extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$cModel = new WebPageCategory ();
		if (rqset ( 'name' )) {
			$where ['name'] = rqst ( 'name' );
		} else {
			$where ['url_path'] = rqst ( 'url_path' );
		}
		$cid = irqst ( 'cid', 0 );
		if (! empty ( $cid )) { // 修改时
			$where ['cid !='] = $cid;
		}
		@header ( 'Content-type: application/json', true );
		echo $cModel->exist ( $where ) ? 'false' : 'true';
	}
}